<?php
include_once('config.php');

if($_POST['post_nhanxet']=='post_nhanxet'){
	$name = trim($_POST['name']);
	$email = trim($_POST['email']);
	$content = trim($_POST['content']);
	$alias = trim($_POST['alias']);
	if($name!='1' && $email!='' && $content!='' && $alias!=''){
		$tc->insert_nhanxet($name,$email,$content,$alias);
		$nhanxet = $tc->view_nhanxet($alias);
		while($row_nx = mysql_fetch_array($nhanxet)){
			$view_post .= '<div class="item">
				<div><span style="font-weight:bold; color:#b60088">'.$row_nx['name'].'</span><span style="color:#666"> &nbsp; | &nbsp; '.$tc->datetime($row_nx['date_create']).'</span></div>
				<div>'.$row_nx['content'].'</div>
			</div>';
		}
		echo $view_post;
		mysql_free_result($nhanxet);
	}else echo '0';
}
if($_POST['order']=='order'){
	$hoten = trim($_POST['hoten']);
	$diachi = trim($_POST['diachi']);
	$dienthoai = trim($_POST['dienthoai']);
	$email = trim($_POST['email']);
	$soluong = trim($_POST['soluong']);
	$yeucau = trim($_POST['yeucau']);
	$total = '';
	$linksp = $_POST['linksp'];
	if($hoten=='' || $diachi=='' || $dienthoai=='' || $soluong=='') return false;
	else{
		$tc->order($hoten,$diachi,$dienthoai,$email,$soluong,$total,$yeucau);
		include_once('guimail/send.php');
	}
}